#!/bin/bash
#输入行数打印菱形形

read -p "输入高度： （行）" head

for ((i=1;i<=head; i++));do
        for ((j=i;j<head; j++));do
                echo -n " "
        done
        for ((k=1;k<=(2*i-1); k++));do
                echo -n "*"
        done
        echo ""
done

for ((i=head-1; i>=1; i--));do
        for ((j=head; j>1; j--));do
                echo -n " "
        done
        for ((k=1; k<=(2*i-1); k++));do
                echo -n "*"
        done
        echo ""
done

